<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            /* width: 100px; */
            /* height: 100px; */
            border:1px black solid;

        }
        .child {
            height: 30px;
            width: 30px;
            background-color: red;
            float:left;
        }
        .container::after {
            content:'';
            display: table;
            clear:left;
        }
        .other {
            clear:both;
        }
        .cbrother {
            border:1px black solid;
            position:absolute;
        }

        /* margin 塌陷问题*/
        .box {
            height:100px;
            width: 100px;
            border:1px black solid;
            
            
        }
        .p1 {
            margin:20px;
            
        }
        .p2 {
            margin:40px;
            
        }
       
    </style>
</head>
<body>
    <div class="cbrother"></div>
    <div class="container p1">
        
        <div class="child">1</div>
        <div class="child">2</div>
        <div class="child">3</div>
        
    </div>
    <div class="cbrother p2">
        <div class="child">1</div>
        <div class="child">2</div>
        <div class="child">3</div>
    </div>

    <div style="overflow: hidden;">
        <div class="box p1">box1</div>
    </div>
    
    <div class="box p2">box2</div>
</body>
</html>